<?php
namespace App\Libraries\Decorator\Image;


use App\Libraries\Decorator\DecoratorInterface\ModelDecorator;
use App\Libraries\Tools\URL;
use App\Models\Product\ProductFile;

class NoImagesDecorator implements ModelDecorator
{

    protected $product_file;

//    public function __construct(ProductFile $product_file){
//        $this->product_file = $product_file;
//    }

    public function before(){

    }

    public function after(&$data){
        if(!is_array($data)){
            $data = json_decode(json_encode($data), true);
        }
        if(is_array($data)){
            unset($data['images']);
            foreach($data as &$v){
                $this->after($v);
            }
        }
        return $data;
    }
}